{extends file='layout/admin.html'}

{block name='title'}User Group Permissions  - Geek-Zoo CMS{/block}

{block name='content'}

<h1>User Group Permissions</h1>
<h2 class="pb10">User Group: {$info.group_name}</h2>
<div class="clearfix sub_nav"><span class="btn fr"><a href="admin/user_group.html">Cancel</a></span><span class="btn fr"><a href="#" class="save">Save</a></span></div>
<form action="admin/user_group/{$info.id}.html" method="post" accept-charset="utf-8">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="content_table">
	<thead>
		<tr style="height: 10px">
			<th class="left" style="width: 5%;"><input type="checkbox" id="ck_all"></th>
			<th style="border-left: 1px solid #CCC; width: 50%;">Module</th>
			<th style="border-left: 1px solid #CCC; width: 45%;" class="right">URL</th>
		</tr>
	</thead>
	<tbody class="text_indent">
	  {$i = 1}
	  {foreach $action_list as $val}
	    {foreach $val as $k => $v}
	    {if $i % 2}<tr>{else}<tr class="odd">{/if}
  	  	<td style="text-align: center;"><input type="checkbox" name="modules[]" value="{$v}" {if in_array($v, $info.modules)}checked {/if}/></td>
  			<td style="border-right-style: none; border-right-width: initial; border-right-color: initial;">{$k}</td>
  			<td style="border-right-style: none; border-right-width: initial; border-right-color: initial;">admin/{$v}</td>
  		</tr>
	    {$i=$i+1}
	    {/foreach}
	  {/foreach}
	</tbody>
</table>
</form>
<div class="clearfix sub_nav">
	<span class="btn fr"><a href="admin/user_group.html">Cancel</a></span><span class="btn fr"><a href="#" class="save">Save</a></span>
</div>
<script type="text/javascript" charset="utf-8">
$('a.save').click(function(){
  $('form').submit();
  return false;
});
$('#ck_all').click(function(){
  $('input[name=modules[]]').attr('checked', $(this).attr('checked'));
});
</script>
{/block}